package org.parademo.model;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.Serializable;

/**
 * This class is the super class for all entities. It provides the support of PropertyChangeEvents
 * to be usable by the getXXX() property getters for each extension of the Entity class.
 * This class may be used to implement common methods for all entities in the future.
 *
 * @author Ajit Skanda
 * @version 1.0
 */
public class Entity implements Serializable {

	protected Long id;

	/**
	 * Support for property change indicators for the properties of the extending classes.
	 */
	protected PropertyChangeSupport pcs = new PropertyChangeSupport(this);

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public void addPropertyChangeListener(PropertyChangeListener p) {
		pcs.addPropertyChangeListener(p);
	}

	public void removePropertyChangeListener(PropertyChangeListener p) {
		pcs.removePropertyChangeListener(p);
	}

}
